/*     */ package com.jcrj.action.personalOffice;
/*     */ 
/*     */ import com.jcrj.action.BaseAction;
/*     */ import com.jcrj.entity.OUser;
/*     */ import com.jcrj.entity.OWorkGroup;
/*     */ import com.jcrj.service.PersonalofficeService;
/*     */ import java.io.IOException;
/*     */ import java.io.PrintWriter;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ import net.sf.json.JSONObject;
/*     */ 
/*     */ public class GroupManagAction extends BaseAction
/*     */ {
/*     */   private String[] ids;
/*     */   private Integer groupId;
/*     */   private String groupname;
/*     */   private List<OWorkGroup> owgList;
/*     */   private List<OUser> userList;
/*     */   private OWorkGroup oWorkGroup;
/*     */   private PersonalofficeService personalofficeService;
/*     */ 
/*     */   public String groupName()
/*     */   {
/*     */     try
/*     */     {
/*  25 */       OWorkGroup og = new OWorkGroup();
/*  26 */       OUser ou = (OUser)super.getSession().get("userInfo");
/*  27 */       og.setName(getGroupname());
/*  28 */       og.setUserid(ou.getId());
/*  29 */       this.personalofficeService.addgroup(og);
/*  30 */       super.getResponse().getWriter().write("success");
/*  31 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/*  33 */       e.printStackTrace();
/*     */       try
/*     */       {
/*  36 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/*  38 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/*  36 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/*  38 */         e.printStackTrace();
/*     */       }
/*     */     }
/*  41 */     return null;
/*     */   }
/*     */ 
/*     */   public String addGroup() {
/*  45 */     return "success";
/*     */   }
/*     */ 
/*     */   public String addGroupUser() {
/*  49 */     this.oWorkGroup = this.personalofficeService.getgroup(this.groupId.intValue());
/*  50 */     return "success";
/*     */   }
/*     */ 
/*     */   public String loadGroupUser() {
/*     */     try {
/*  55 */       super.getResponse().setCharacterEncoding("UTF-8");
/*  56 */       List userlist = this.personalofficeService.getgroupuse(this.groupId.intValue());
/*  57 */       JSONObject json = new JSONObject();
/*  58 */       json.put("userlist", userlist);
/*  59 */       super.getResponse().getWriter().write(json.toString());
/*  60 */       super.getResponse().getWriter().flush();
/*     */     } catch (IOException e) {
/*  62 */       e.printStackTrace();
/*     */       try
/*     */       {
/*  65 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/*  67 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/*  65 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/*  67 */         e.printStackTrace();
/*     */       }
/*     */     }
/*  70 */     return null;
/*     */   }
/*     */ 
/*     */   public String saveGroupUser() {
/*  74 */     this.personalofficeService.addgroupuser(this.groupId.intValue(), this.ids);
/*  75 */     return null;
/*     */   }
/*     */ 
/*     */   public String groupList() {
/*  79 */     OUser ou = (OUser)getSession().get("userInfo");
/*  80 */     this.owgList = this.personalofficeService.getGroup(ou.getId().intValue());
/*  81 */     for (int i = 0; i < this.owgList.size(); i++) {
/*  82 */       ((OWorkGroup)this.owgList.get(i)).setUserName(this.personalofficeService.getgroupuse(((OWorkGroup)this.owgList.get(i)).getId().intValue()));
/*     */     }
/*  84 */     return "success";
/*     */   }
/*     */ 
/*     */   public String deleteGroup() {
/*     */     try {
/*  89 */       this.personalofficeService.deleteGroup(this.ids);
/*  90 */       getResponse().getWriter().write("success");
/*     */     } catch (Exception e) {
/*  92 */       e.printStackTrace();
/*     */     }
/*  94 */     return null;
/*     */   }
/*     */ 
/*     */   public String[] getIds()
/*     */   {
/* 100 */     return this.ids;
/*     */   }
/*     */ 
/*     */   public void setIds(String[] ids) {
/* 104 */     this.ids = ids;
/*     */   }
/*     */ 
/*     */   public Integer getGroupId() {
/* 108 */     return this.groupId;
/*     */   }
/*     */ 
/*     */   public void setGroupId(Integer groupId) {
/* 112 */     this.groupId = groupId;
/*     */   }
/*     */ 
/*     */   public String getGroupname() {
/* 116 */     return this.groupname;
/*     */   }
/*     */ 
/*     */   public void setGroupname(String groupname) {
/* 120 */     this.groupname = groupname;
/*     */   }
/*     */ 
/*     */   public List<OWorkGroup> getOwgList() {
/* 124 */     return this.owgList;
/*     */   }
/*     */ 
/*     */   public void setOwgList(List<OWorkGroup> owgList) {
/* 128 */     this.owgList = owgList;
/*     */   }
/*     */ 
/*     */   public List<OUser> getUserList() {
/* 132 */     return this.userList;
/*     */   }
/*     */ 
/*     */   public void setUserList(List<OUser> userList) {
/* 136 */     this.userList = userList;
/*     */   }
/*     */ 
/*     */   public OWorkGroup getOWorkGroup() {
/* 140 */     return this.oWorkGroup;
/*     */   }
/*     */ 
/*     */   public void setOWorkGroup(OWorkGroup workGroup) {
/* 144 */     this.oWorkGroup = workGroup;
/*     */   }
/*     */ 
/*     */   public PersonalofficeService getPersonalofficeService() {
/* 148 */     return this.personalofficeService;
/*     */   }
/*     */ 
/*     */   public void setPersonalofficeService(PersonalofficeService personalofficeService) {
/* 152 */     this.personalofficeService = personalofficeService;
/*     */   }
/*     */ }

/* Location:           /Volumes/work/oa/WEB-INF/classes/
 * Qualified Name:     com.jcrj.action.personalOffice.GroupManagAction
 * JD-Core Version:    0.6.0
 */